var multDim = [[ 1,[ 2, 3]],[ 4, 5],[ 6, 7, { a : 8 }]]

var oneDimA = (function () {
    var one = []
    function oneDim (arr) {
        arr.forEach((item) => {
            if(Array.isArray(item)){
                oneDim(item)
            }else{
                one.push(item)
            }
        } )
        return one
    }
    return {
        oneDim
    }
})()

var a = oneDimA.oneDim(multDim)
console.log(a)

// 仅限 数字 拍平
var str = multDim.toString()
var newArr = str.split(',')
console.log(newArr)

